snapshot: Fix assert in inhibition
authorAlexander Larsson <alexl@redhat.com>
Thu, 4 Jun 2020 10:37:48 +0000 (12:37 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 4 Jun 2020 12:22:27 +0000 (14:22 +0200)
commitb4af23be23f04c02c9ce633c033fc145349ca45b
tree77460f543db9b7bb878bb02a64ab0a8850527341
parent36314c3ff7c803d950e9147b9efe471c0c702b1a
snapshot: Fix assert in inhibition

In https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2027 i was getting

Bail out! ERROR:../testsuite/reftests/reftest-snapshot.c:212:reftest_uninhibit_snapshot: assertion failed: (inhibit_count > 0)

In (for example the box-shadow-changes-modify-clip reftest. I can reproduce this (on master) with:

```
$ xvfb-run -a -s "-screen 0 1024x768x24" meson test --suite gtk:reftest "reftest box-shadow-changes-modify-clip.ui"
...
1/1 gtk:reftest / reftest box-shadow-changes-modify-clip.ui ERROR          0.77s
``

Fix this by re-inhibiting if we didn't draw anything, or we will get an assert the next paint.
testsuite/reftests/reftest-snapshot.c